package cn.cboard.dao.sql;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import cn.cboard.database.RowMapper;
import cn.cboard.model.Forum;

public class ForumMapper implements RowMapper{

	public List<Forum> mapRow(ResultSet rs) throws SQLException {
		List<Forum> list = new ArrayList<Forum>();		
		while(rs.next()){
			Forum forum = new Forum();
			forum.setForumId(rs.getLong("forumId"));
			forum.setDescription(rs.getString("description"));
			forum.setTitle(rs.getString("title"));			
			list.add(forum);
		}
		return list;
	}
}
